<template>
	<view class="box">
		<view class="header">
			<view class="iconfont icon-fanhui" @click="fanhui">返回</view>
			<view class="">消息提醒</view>
			<view class=""> </view>
		</view>
		<view class="xiaoxi" v-for="i in table"  v-show='i.xjs_qudao =="小程序"' @click="xinxi(i)">
			<text>{{i.xjs_neirong}}</text>
			<view class="tt">
			<view :class=" i.xjs_zhangtai != '未读' ?  'active'  : 'ZHUANGTAI' ">  {{i.xjs_zhangtai}}</view>
			<view class="">{{i.xjs_time}}</view>

			</view>
		</view>
		<!-- <view class="xiaoxi">
			<text>您在2020年前三个季度。。。。。</text>
			<view class="ZHUANGTAIB">已读</view>
			<view class="">2020-11-9</view>
			<view class="">12:00</view>
		</view> -->
	</view>
</template>

<script>
	import {
		ref,
		computed,
		reactive,
		toRefs,onMounted
	} from 'vue'
	
	import {useStore} from "vuex"
import http from '../../../utils/http.js'
	export default {
		setup() {
					let {state, commit} = useStore()
			let data = reactive({
				table:[],
				xinxi(i) {	
				 commit("chaobiao/updateUserInfo", {name:i})
					uni.navigateTo({
						url: '../chakanxiaoxitixing/chakanxiaoxitixing'
					})
				},
				fanhui(){
								uni.navigateBack({
									delta:1
								})
							}
			});
             onMounted(() => {
            http({
            	url: "/xinxi/getxiaoxijieshou",
            	method: "get",
            					
            }).then((res) => {
            
            	data.table=res.data.data
             })
         })
			return {
				...toRefs(data)
			};
		},
		onLoad() {},
		
	}
</script>

<style lang="scss">
	@import url("~@/static/xzafont/font/iconfont.css");

	.header .icon-fanhui {
		font-size: 35rpx;
	}

	.box {
		font-size: 35rpx;
	}

	.header {
		display: flex;
		justify-content: space-between;
		/* background-color: #FFFFFF; */
		// line-height: 90rpx;
		margin: 0 30rpx;
		border-bottom: 1rpx solid #F8F8F8;
	}

	.xiaoxi {
		
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		border: 1rpx solid #E4E4E4;
		// height: 100rpx;
		padding: 5rpx 30rpx;
	}
      .xiaoxi    text{
		   width: 600rpx;
		  overflow: hidden;
		  
		  text-overflow:ellipsis;
		  
		  white-space: nowrap;
	  }
	 .xiaoxi view {
		margin: 10rpx 10rpx;
	}
  
.tt{
	width: 750rpx;
	display: flex;
	justify-content: space-between;
}
.tt text{
	flex: 1;
	display: inline-block;
}
	.ZHUANGTAI {
		color:  #ff0000;
	}
.active{
	color: #8DC536;
}
	
</style>
